/**
 * 
 */
package mx.netbrain.bean;

import java.io.IOException;
import java.io.Serializable;
import java.util.Properties;

import org.apache.log4j.Logger;

/**
 * @author julian
 * 
 */
public class ChangePropertiesBean implements Serializable {

	/**
	 * 
	 */
	private static final long serialVersionUID = 8992292186036755472L;
	private static final Logger logger = Logger.getLogger(WebBean.class);
	private String value;

	Properties properties = null;
	/** Configuration file name */
	public final static String CONFIG_FILE_NAME = "ApplicationResources.properties";
	public final static String CONFIG_FILE_NAME_EN = "ApplicationResources_en.properties";

	public ChangePropertiesBean() {
		this.properties = new Properties();
		try {
			properties.load(ChangePropertiesBean.class.getClassLoader()
					.getResourceAsStream(CONFIG_FILE_NAME));
		} catch (IOException ex) {
			ex.printStackTrace();
			logger.error(ex);
		}
	}

	public static ChangePropertiesBean getInstance() {
		return ChangePropertiesHolder.INSTANCE;
	}

	private static class ChangePropertiesHolder {
		private static final ChangePropertiesBean INSTANCE = new ChangePropertiesBean();
	}

	public String getProperty(String key) {
		return this.properties.getProperty(key);
	}

	public String getValue() {
		return value;
	}

	public void setValue(String value) {
		this.value = value;
	}

}
